﻿<%@ Page Language="C#" MasterPageFile="~/Shared/FormPage.Master" AutoEventWireup="true" CodeBehind="WorkItemAdd.aspx.cs" Inherits="Microsoft.JCI.Portal.Agent.WorkItemAdd" StylesheetTheme="GlobleTheme"%>

<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<%@ Register src="../UserControl/CustomerCtrl.ascx" tagname="CustomerCtrl" tagprefix="uc1" %>

<%@ Register assembly="RadInput.Net2" namespace="Telerik.WebControls" tagprefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script src="../Content/global.js" type="text/javascript"></script>
    <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Grid/Grid.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function CheckForm() {
            return true;
        }

        function WorkingVendorPartsadd() {
            openMyFullWin('WorkingVenderPartsAdd.aspx', 'WorkingVenderPartsAdd');
            return false;
        }

        function OnPartsAdd() {
            if (document.getElementById('<%=txtWorkingVendorOrderId.ClientID %>').value == '') {
                alert('请先保存派单信息!');return false;
            }
            window.radopen("WorkItemPartAdd.aspx?OrderID=" + document.getElementById('<%=txtWorkingVendorOrderId.ClientID %>').value, "WorkItemPartAdd");
            return false;
        }
        
        function PartsAddCallBack() {
            document.getElementById('<%=btnRefershParts.ClientID %>').click();
        }
        function LogsCallBack(){
            document.getElementById('<%=btnRefershLogs.ClientID %>').click();
        }
        function OnLogAdd() {
            if (document.getElementById('<%=txtWorkingVendorOrderId.ClientID %>').value == '') {
                alert('请先保存派单信息!'); return false;
            }
            window.radopen("LogAdd.aspx?OrderID=" + document.getElementById('<%=txtWorkingVendorOrderId.ClientID %>').value, "LogAdd");
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphFormArea" runat="server">
    <rad:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Office2007" Left=""
        NavigateUrl="" SkinsPath="~/RadControls/Window/Skins" Title="" Top="">
        <Windows>
            <rad:RadWindow ID="WorkItemPartAdd" runat="server" Title="新增零件" Height="400px" Width="500px" ReloadOnShow="true" Modal="true"  OnClientClose="PartsAddCallBack" />
               <rad:RadWindow ID="LogAdd" runat="server" Title="新增日志" Height="400px" Width="500px" ReloadOnShow="true" Modal="true"  OnClientClose="LogsCallBack" />
        </Windows>
    </rad:RadWindowManager>
    
    <div id="areaForm2" class="area">
    
       <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td width="9">
                        <img hspace="3" src="../Content/Menu/mnu_vSpacer.gif">
                    </td>
                    <td class="icMenu" nowrap>
                        <asp:LinkButton ID="lnkbtnSave" runat="server" 
                            OnClientClick="return CheckForm();" onclick="lnkbtnSave_Click"><span class="menu" title="保存"><img class="mnuBtn" src="../Content/Menu/SaveNew_16_blue.gif"><span class="mnuBtn">保存</span></span></asp:LinkButton>
                        <asp:LinkButton ID="lnkbtnSaveAndClose" runat="server" 
                            OnClientClick="return CheckForm();" onclick="lnkbtnSaveAndClose_Click"><span class="menu" title="保存&amp;关闭" onclick="window.execScript(this.action);"><img class="mnuBtn" src="../Content/Menu/SaveClose_16_blue.gif"><span class="mnuBtn">保存&amp;关闭</span></span></asp:LinkButton>
                        <img src="../Content/Menu/separator.gif">
                        <span class="menu" title="关闭" onclick="window.close();">
                            <img class="mnuBtn" src="../Content/Menu/Close_16_blue.gif"><span class="mnuBtn">关闭</span></span>
                    </td>
                </tr>
            </tbody>
        </table>
        
     <table class="mnubar" cellspacing="0" cellpadding="0" height="400px">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>客户信息</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap>
                    </td>
                    <td class="icMenu mnuRight" nowrap>
                    </td>
                </tr>
            </tbody>
        </table> 
        <div style="display: inline" id="appForm_tab0" class="tab">
           <uc1:CustomerCtrl ID="ucCustomerCtrlInfo" runat="server" />
        </div>
            <div style="margin: 5px 0 5px 0">
        </div>  

        <table class="mnubar" cellspacing="0" cellpadding="0" height="400px">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>报修信息</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap>
                    </td>
                    <td class="icMenu mnuRight" nowrap>
                    </td>
                </tr>
            </tbody>
        </table>
        
        <div style="display: inline" id="Div2" class="tab">
              <table style="table-layout: fixed" id="Table2" cellspacing="0" cellpadding="3" width="100%">
                <colgroup>
                    <col width="110" />
                    <col/>
                    <col width="110"/>
                    <col/>
                </colgroup>
                <tbody>
                        <tr>
                            <td class="req">
                                维修记录编号</td>
                            <td>
                                <asp:TextBox ID="txtJobOrderNo" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                            <td align="right">
                                性质</td>
                            <td> 
                                <asp:CheckBoxList ID="cblProperty" runat="server" RepeatDirection="Horizontal"></asp:CheckBoxList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                机组型号</td>
                            <td>
                                <asp:TextBox ID="txtUnitModel" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                            <td align="right">机组出厂编号</td>
                            <td>
                                <asp:TextBox ID="txtFactorySerialNo" runat="server" CssClass="input"></asp:TextBox>
                            </td> 
                        </tr>  
                        <tr>
                            <td>压缩机编号</td>
                            <td>
                                <asp:TextBox ID="txtCompressorSerialNo" runat="server" CssClass="input"></asp:TextBox>
                             </td>
                            <td align="right">油型</td>
                            <td>
                                <asp:TextBox ID="txtOilType" runat="server" CssClass="input"></asp:TextBox></td> 
                        </tr>  
                        <tr>
                            <td>
                                人工费</td>
                            <td> 
                                <rad:RadNumericTextBox ID="txtLabor" Runat="server"></rad:RadNumericTextBox>
                            </td>
                            <td align="right">
                                住宿费</td>
                            <td>
                                <rad:RadNumericTextBox ID="txtLodging" Runat="server">
<NumberFormat AllowRounding="True"></NumberFormat>
                                </rad:RadNumericTextBox>
                            </td> 
                        </tr>  
                             <tr>
                            <td>
                                杂费</td>
                            <td>
                                <rad:RadNumericTextBox ID="txtMisc" Runat="server">
<NumberFormat AllowRounding="True"></NumberFormat>
                                </rad:RadNumericTextBox>
                            </td>
                            <td align="right">差旅</td>
                            <td>
                                <rad:RadNumericTextBox ID="txtTransportation" Runat="server">
<NumberFormat AllowRounding="True"></NumberFormat>
                                </rad:RadNumericTextBox>
                            </td> 
                        </tr>
                         <tr>
                            <td align="left">
                                材料费</td>
                            <td> 
                                <rad:RadNumericTextBox ID="txtMaterial" Runat="server">
<NumberFormat AllowRounding="True"></NumberFormat>
                                </rad:RadNumericTextBox>
                            </td>
                            <td>保修索赔</td>
                            <td>
                                <asp:DropDownList ID="ddlWarrantyClain" runat="server">
                                <asp:ListItem>是</asp:ListItem>
                                <asp:ListItem>否</asp:ListItem>
                                </asp:DropDownList>
                             </td>
                        </tr>                                                        
                         <tr>
                            <td align="left">
                                维修主任批准</td>
                            <td> 
                                <asp:TextBox ID="txtApprovedByOfficer" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                            <td>生产厂批准</td>
                            <td>
                                <asp:TextBox ID="txtApprovedByFty" runat="server" CssClass="input"></asp:TextBox>
                             </td>
                        </tr>                                                        
                         <tr>
                            <td align="left">故障描述</td>
                            <td colspan="3">  
                                <asp:TextBox ID="txtFaultDescription" runat="server" CssClass="input" Height="55px" TextMode="MultiLine"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">处理过程</td>
                            <td colspan="3">  
                                <asp:TextBox ID="txtResolvingAction" runat="server" CssClass="input" Height="55px" TextMode="MultiLine"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">完成情况</td>
                            <td>  
                                <asp:DropDownList ID="ddlServiceStatus" runat="server">
                                <asp:ListItem Text="已完成" Value="Completed"></asp:ListItem>
                                <asp:ListItem Text="未完成" Value="Incompleted"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>故障代码</td>
                            <td><asp:TextBox ID="txtFaultCode" runat="server" CssClass="input"></asp:TextBox></td>
                        </tr>
                    </tbody>
            </table>
        </div>
        
          <div style="margin: 5px 0 5px 0">
        </div>  
        <table class="mnubar" cellspacing="0" cellpadding="0" height="400px">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>零件Parts</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap> </td>
                    <td class="icMenu mnuRight" nowrap>
                          <span class="menu"  onclick="return OnPartsAdd();">
                        <img class="mnuBtn" src="../Content/Grid/New_16_blue.gif"><span class="mnuBtn">新增零件</span></span>
                    </td>
                </tr>
            </tbody>
        </table>
        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
        </div>
        <asp:CheckBoxList ID="cblPartProperty" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Text="保用"></asp:ListItem>
                        <asp:ListItem Text="收费"></asp:ListItem>
                        <asp:ListItem Text="内部转帐"></asp:ListItem>
                        <asp:ListItem Text="保养"></asp:ListItem>
        </asp:CheckBoxList>
        <rad:RadGrid runat="server" ID="radGridWorkingVenderParts" AutoGenerateColumns="False" 
                               AllowSorting="false" onitemcommand="radGridWorkingVenderParts_ItemCommand" 
                               onneeddatasource="radGridWorkingVenderParts_NeedDataSource">
            <MasterTableView DataKeyNames="WorkingVenderPartsId">
                <Columns>
                    <rad:GridBoundColumn HeaderText="零件名称" DataField="PartName">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="零件编号" DataField="PartCode">
                    </rad:GridBoundColumn> 
                    <rad:GridBoundColumn HeaderText="数量" DataField="Count">
                    </rad:GridBoundColumn> 
                      <rad:GridTemplateColumn HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkbtnDelete" runat="server" CommandName="delete">删除</asp:LinkButton>
                        </ItemTemplate>
                    </rad:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </rad:RadGrid>
        
          <div style="margin: 5px 0 5px 0"></div>
          
          <table class="mnubar" cellspacing="0" cellpadding="0" height="400px">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>工程师Engineer/工作时间记录Log.</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap>
                    </td>
                    <td class="icMenu mnuRight" nowrap>
                       <span class="menu"  onclick="return OnLogAdd();">
                        <img class="mnuBtn" src="../Content/Grid/New_16_blue.gif"><span class="mnuBtn">新增记录</span></span>
                    </td>
                </tr>
            </tbody>
        </table>
        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
        </div>
        
        <rad:RadGrid runat="server" ID="radGridEngineerLogs" 
            AutoGenerateColumns="False" AllowSorting="false" 
            OnNeedDataSource="radGridEngineerLogs_NeedDataSource" 
            onitemdatabound="radGridEngineerLogs_ItemDataBound">
            <MasterTableView DataKeyNames="WorkingVendorEngineer">
                <Columns>
                    <rad:GridBoundColumn HeaderText="日期" DataField="Date">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="工程师" DataField="EngineerName">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="出发时间" DataField="DT">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="到工地时间" DataField="AT">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="离开工地时间" DataField="LT">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="实际工时" DataField="T">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="去往" DataField="WS">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="正常工时" DataField="HRS">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="审核工时" DataField="CheckHour">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="旅途" DataField="TT">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="加班" DataField="OT">
                    </rad:GridBoundColumn>
                    <rad:GridTemplateColumn HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkbtnEditLog" runat="server">修改</asp:LinkButton>
                        </ItemTemplate>
                    </rad:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </rad:RadGrid>
    </div>
    <asp:HiddenField ID="txtDispatchFormID" runat="server" />
    <asp:HiddenField ID="txtWorkingVendorOrderId" runat="server" />
    <asp:HiddenField ID="txtCustomerID" runat="server" />
     <asp:HiddenField ID="txtWorkingVendorOrderOtherItemId" runat="server" />
    <asp:Button ID="btnRefershParts" runat="server" Text="刷新零件列表" onclick="btnRefershParts_Click" style="display:none"/>
     <asp:Button ID="btnRefershLogs" runat="server" Text="刷新日志" onclick="btnRefershLogs_Click" style="display:none"/>
</asp:Content>
